package com.algorithms.arrays;

import com.algorithms.utils.AlgorithmException;

@SuppressWarnings("unchecked")
public abstract class AbstractArray<T> {
	public static final int MAX_ARRAY_COUNT = 10000;
	public static final int INVALID_INDEX = -1;
	
	protected T[] data;
	protected int maxElementCount;
	protected int length;

	public AbstractArray(){
		this.data = (T[])new Object[MAX_ARRAY_COUNT];
		this.maxElementCount = MAX_ARRAY_COUNT;
		this.length = 0;
	}
	
	public AbstractArray(int maxElementCount){
		this.data = (T[])new Object[maxElementCount];
		this.maxElementCount = maxElementCount;
		this.length = 0;
	}
	
	public abstract T pop() throws AlgorithmException;
	public abstract void push(T value) throws AlgorithmException;
	public abstract T peak();
	public abstract boolean isEmpty();
	public abstract boolean isFull();
	
	public int size(){
		return length;
	}
	
}
